<template>
    <div class="settings-page">
      <!-- 其他设置内容 -->
      <Header :title="title" :isWhite="false"></Header>
      <button @click="handleLogout" class="logout-btn">退出登录</button>
    </div>
  </template>
  
  <script setup>
  import { useRouter } from 'vue-router'
  import { useUserStore } from '@/stores/userStore'
  import Header from '@/components/Header.vue';
  const router = useRouter()
  const userStore = useUserStore()
  const title = '设置';
  const handleLogout = () => {
    userStore.logout()
    router.push({ name: 'mine' }) // 根据路由配置中的 name 跳转
  }
  </script>
   
  <style scoped>
  .settings-page {
    padding: 2em;
  }
  .logout-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  </style>